package com.young.design.pattern.adapter;

/**
 * @ClassName : ChinaPowerAdapter
 * @Author : hyy
 * @Date: 2020-03-16
 */
public class ChinaPowerAdapter implements DC5Adapter {
    private final int input = 220;

    @Override
    public boolean support(AC ac) {
        if (input==ac.output()){
            return true;
        }
        return false;
    }

    @Override
    public int outputDC5V(AC ac) {
        boolean support = support(ac);
        if (support){
            System.out.println("china 220AC adapter 5DC");
            return ac.output()/44;
        }else{
            return 0;
        }

    }
}
